From news-rocq!jussieu.fr!univ-angers.fr!enst!freenix!sunqbc.risq.qc.ca!nntp.primenet.com!nntp.gctr.net!newspeer.monmouth.com!nntp2.deja.com!nnrp1.deja.com!not-for-mail Thu Jul 29 20:39:37 1999 Article: 10455 of rec.games.corewar Path: news-rocq!jussieu.fr!univ-angers.fr!enst!freenix!sunqbc.risq.qc.ca!nntp.primenet.com!nntp.gctr.net!newspeer.monmouth.com!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Ben Ford Newsgroups: rec.games.corewar Subject: Re: Beginner Date: Mon, 26 Jul 1999 21:05:40 GMT Organization: Deja.com - Share what you know. Learn what you don't. Lines: 85 Message-ID: <7niiiv$1s$1@nnrp1.deja.com> References: <378f6ab2.42631388@news.iafrica.com> <379A10BC.48C3E9CC@nwonline.net> NNTP-Posting-Host: 207.170.76.162 X-Article-Creation-Date: Mon Jul 26 21:05:40 1999 GMT X-Http-User-Agent: Mozilla/4.5 [en] (WinNT; U) X-Http-Proxy: 1.0 x32.deja.com:80 (Squid/1.1.22) for client 207.170.76.162 X-MyDeja-Info: XMYDJUIDbenford Xref: news-rocq rec.games.corewar:10455 In article <379A10BC.48C3E9CC@nwonline.net>, Charles Oblender wrote: > Here's a bomber I wrote which is based on Dwarf and a core clear that I > stole from muteagen. > > ;redcode-b > ;name clearance .4 > ;author Charles > ;strategy Bombs core every 2 addreses then enters core clear. > ;assert CORESIZE==8000 > > org dwarf > spl 0, <2667 ;slow enemy processes down > dwarf add #2, 3 > mov -2, @2 > djn -2, #3973 ;used as counter to keep from bombing self > clear jmp a1, #12 ;falls through to core clear > ptr1 dat a1, c+100 > a4 dat 0, c+2+1 > a3 dat 1, c+2+2 > a2 spl #2, c+2+3 ; spl #X, <-Y acts like a split 0. > a1 spl #3, c+2+4 ; you can use x and Y as step values > mov *ptr1, >ptr1 ; and use the decrement in the b-field > mov *ptr1, >ptr1 ; as part of an imp gate. > mov *ptr1, >ptr1 ; > (post-increment) keeps adding 1 to > c djn.f -3, <4000 ; the b-field of ptr1 to move the bomb > ; through core. > end > > any suggestions? The first problem with the code is the step size of 2. Doing the mov + add take 2 instructions to advance 2 spots. Just doing 2 mov's like in the coreclear will do the same job. So you are basically doing a coreclear but skipping every other line for some reason. So I would increase the step size. Staying at a mod-2 would take a bit of testing to what would be good (need to step initial point well) so I'll go with a mod-8, hitting every 8th location. Not quite as thorough, but the coreclear will take care of that. Next I would make the djn be hit by the spl to start the core-clear, this allows the djn to be uses as an attack method also. It also lets the spl be used to help make the initial dwarf attack a bit more robust. Next I'll more all the spls and dats of the coreclear to the top of the code to get rid of the jmp to the coreclear, saving another instruction. Then the spl a top can be used for the first pass of the coreclear, saving another instruction. Having two dats that were the same seemed pointless so I removed the second one. Here is the result of using all those changes. ;redcode-b ;name clearance .4 ;author Charles ;strategy Bombs core every 8 addreses then enters core clear. ;assert CORESIZE==8000 step equ 2376 ; 2376=8*297, will eventually bomb every 8th address org dwarf ptr1 dat dwarf, c+100 a3 dat #0, c+2+2 a2 spl #1, c+2+3 ;spl #X, <-Y acts like a split 0. dwarf spl #2, <2667 ;slow enemy processes down ptr mov dwarf, hit+step add #step, ptr hit djn -2, ptr1 ; and use the decrement in the b-field mov *ptr1, >ptr1 ; as part of an imp gate. mov *ptr1, >ptr1 ; > (post-increment) keeps adding 1 to c djn.f -3, <4000 ; the b-field of ptr1 to move the bomb ; through core. end It can probably be further improved by adding a qscan and a boot routine, maybe also adding an anti-imp section to the clear. But these changes at least get in on the beginner's hill. -Ben Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.